package org.dkakunsi.aplikasitoko.data.entity;

import java.util.Collection;
import java.util.ArrayList;

import org.dkakunsi.aplikasitoko.data.util.Generator;

public class Kasir {

	private String kode;
	private String nama;
	private String pass;
	private Collection<Log> listLog = new ArrayList<>();
	
	public Kasir() { }
	
	public Kasir(String kode, String nama, String pass) {
		this.kode = kode;
		this.nama = nama;
		this.pass = pass;
	}
	
	/**
	 * @return the kode
	 */
	public String getKode() {
		return kode;
	}

	/**
	 * @param kode the kode to set
	 */
	public void setKode(String kode) {
		this.kode = kode;
	}

	/**
	 * @return the nama
	 */
	public String getNama() {
		return nama;
	}

	/**
	 * @param nama the nama to set
	 */
	public void setNama(String nama) {
		this.nama = nama;
	}

	/**
	 * @return the pass
	 */
	public String getPass() {
		return pass;
	}

	/**
	 * @param pass the pass to set
	 */
	public void setPass(String pass) {
		this.pass = pass;
	}

	/**
	 * @return the list
	 */
	public Collection<Log> getListLog() {
		return listLog;
	}

	/**
	 * @param list the list to set
	 */
	public void setListLog(Collection<Log> listLog) {
		this.listLog= listLog;
	}
	
	public void addLog(Log log) {
		log.setKode(Generator.getLogKode(this));
		log.setKasir(this);
		listLog.add(log);
	}

}
